package com.xiaomei.manager.quartz;

import java.util.Date;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import com.xiaomei.manager.service.IBroadcastService;

/**
 * 广播定时发送任务
 * @author Administrator
 *
 */
public class BroadcastPushJob {

	private Logger logger = Logger.getLogger(BroadcastPushJob.class);

	@Autowired
	private IBroadcastService broadcastService;
	
	protected void execute() {
		logger.info("BroadcastPushJob start：" + new Date());
		
		// 更新广播状态为预发布且当前时间超过发布时间的广播， 将状态更新为正常
		int result = broadcastService.pushBeforeBroadcast();
		
		logger.info("BroadcastPushJob 更新成功数量:" + result);
		
		logger.info("BroadcastPushJob end：" + new Date());
	}
}
